<template>
	<w-toast v-model="show" :title="handleLang('取消求购')" :content="handleLang('当订单数量大于1时，取消订单只能取消求购中的订单，不能取消求购成功的订单。')" content-align="center"
		@action='cancelFn' :cancelText="handleLang('我再想想')" :submitText="handleLang('确认取消')"></w-toast>
</template>

<script>
	import {
		cancelEntrustOrder
	} from '@/api/trad/index.js'
	export default {
		props: {
			order: {
				type: Object,
				default () {

				}
			}
		},
		data() {
			return {
				show: false
			}
		},
		methods: {
			cancel() {
				this.show = true
			},
			cancelFn(res) {
				if (res) {
					cancelEntrustOrder({order_id:this.order.id}).then(res => {
						uni.showToast({
							title:res.msg
						})
						this.order.order_status=4
					})
				}
			}
		}
	}
</script>

<style>
</style>